<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    const PI = 3.14;
</script>

<script>
     console.log(PI);
     username = "ss";
     console.log(username);
     var age = 20;
     console.log(age);
     age = "hello";
     console.log(username);
     console.log(age);

     {
         // 全局变量
         var pass = "123";
         let email = "aa@163.com";
         console.log(email);
     }
     console.log(pass);
     //console.log(email);
 /*   var test = 20;
    test = "张三";

    alert(test);*/

    /*
        var:
            1. 作用域：全局变量
            2. 变量可以重复定义


     */

    //
    // {
    //     let age = 30;
    //     let age2 = 20;
    //     //var age = 20;
    //
    // }
    // alert(age);
    //
    // const PI = 3.14;
    //PI = 3;

</script>
</body>
</html>